﻿@model ThuySan.Models.ImageModel
@{
    ViewBag.Title = "Update Image";
    Layout = "~/Areas/Backend/Views/Shared/_Dialog.cshtml";
}
@if (true == ViewBag.Completed)
{
    <script language="javascript">
        $(document).ready(function() {
            window.parent.closePopupEdit(true);
        })
    </script>
}
else
{
    using (Html.BeginForm("EditImage", "Product", FormMethod.Post, new {
                                                                              enctype = "multipart/form-data"
                                                                      }))
    {
        @Html.HiddenFor(c => c.Id)
        @Html.HiddenFor(c => c.ProductId)
        <div class="input-item">
            <label>
                Image</label>
            <input type="file" name="thumbnail" id="thumbnail" />
            @Html.ValidationMessageFor(c => c.ImageName)
        </div>
        <div class="input-item">
            <label>
                Priority</label>
            @Html.TextBoxFor(c => c.Priority, new {
                                                          @class = "text-input tiny-input"
                                                  })
            @Html.ValidationMessageFor(c => c.Priority)
        </div>
        <div class="input-item">
            <label>
                Description</label>
            @Html.TextAreaFor(c => c.Description, new {
                                                              @class = "text-input large-input"
                                                      })
            @Html.ValidationMessageFor(c => c.Description)
        </div>
        <div class="input-item">
            <label>
                Is Banner</label>
            @Html.CheckBoxFor(c => c.IsBanner)
            @Html.ValidationMessageFor(c => c.IsBanner)
        </div>    
        <input type="submit" value="Update" class="button" />
        <input type="reset" value="Reset" class="button" onclick=" javascript:window.parent.closePopupEdit(); " />
    }
}